package com.example.studentsystem;

import androidx.appcompat.app.AppCompatActivity;

import android.annotation.SuppressLint;
import android.app.ActivityOptions;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;


public class MainActivity extends AppCompatActivity {

    private EditText mEdit1;
    private EditText mEdit2;
    private EditText mEdit3;
    private EditText mEdit4;
    private EditText mEdit5;
    private Button mButton;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mEdit1.findViewById(R.id.edit1);
        mEdit2.findViewById(R.id.edit2);
        mEdit3.findViewById(R.id.edit3);
        mEdit4.findViewById(R.id.edit4);
        mEdit5.findViewById(R.id.edit5);
        mButton.findViewById(R.id.button);
        mButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String name = mEdit1.getText().toString();
                String grade=mEdit2.getText().toString();
                String username = mEdit4.getText().toString();
                String id=mEdit3.getText().toString();
                String password=mEdit5.getText().toString();
                Intent intent = new Intent();
                intent.putExtra("name", name);
                intent.putExtra("grade",grade);
                intent.putExtra("username",username);
                intent.putExtra("password",password);
                intent.putExtra("id",id);

                setResult(RESULT_OK, intent);
                onBackPressed();
            }
        });
    }

}